package com.education.platform.api.service.impl;

import com.education.platform.dao.entity.QuestionBankDO;
import org.springframework.beans.factory.annotation.Autowired;
import com.education.platform.common.service.impl.BaseServiceImpl;
import com.education.platform.dao.QuestionBankDao;
import org.springframework.stereotype.Service;
import com.education.platform.api.service.QuestionBankService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
* describe: 题库
* @author : tomato
* @date: 2020-06-06 02:55:52.991
**/
@Service
public class QuestionBankServiceImpl extends BaseServiceImpl<QuestionBankDao, QuestionBankDO> implements QuestionBankService {

	private static final Logger LOGGER = LoggerFactory.getLogger(QuestionBankServiceImpl.class);

    @Autowired
	private QuestionBankDao questionBankDao;

    /**
     * 获取随机题目
     * @param questionBankDO
     * @return
     */
    @Override
    public List<QuestionBankDO> getRandomList(QuestionBankDO questionBankDO) {
        return questionBankDao.getRandomList(questionBankDO);
    }

    /**
     * 获取试卷题目
     * @param paperId
     * @return
     */
    @Override
    public List<QuestionBankDO> getQuestionsByPaperId(Integer paperId) {
        return questionBankDao.getQuestionsByPaperId(paperId);
    }
}
